ListPopupWindow

(SESL variant) Static library support version of the framework's android.widget.ListPopupWindow. Used to write apps that run on platforms prior to Android L. When running on Android L or above, this implementation is still used; it does not try to switch to the framework's implementation. See the framework SDK documentation for a class overview.

See also

Inheritors

Constructors

Link copied to clipboard
constructor(@NonNull context: @NonNull Context)
Create a new, empty popup window capable of displaying items from a ListAdapter.
constructor(@NonNull context: @NonNull Context, @Nullable attrs: @Nullable AttributeSet)
Create a new, empty popup window capable of displaying items from a ListAdapter.
constructor(@NonNull context: @NonNull Context, @Nullable attrs: @Nullable AttributeSet, @AttrRes defStyleAttr: Int)
Create a new, empty popup window capable of displaying items from a ListAdapter.
constructor(@NonNull context: @NonNull Context, @Nullable attrs: @Nullable AttributeSet, @AttrRes defStyleAttr: Int, @StyleRes defStyleRes: Int)
Create a new, empty popup window capable of displaying items from a ListAdapter.

Properties

Link copied to clipboard
Mode for setInputMethodMode: the requirements for the input method should be based on the focusability of the popup.
Link copied to clipboard
Mode for setInputMethodMode: this popup always needs to work with an input method, regardless of whether it is focusable.
Link copied to clipboard
Mode for setInputMethodMode: this popup never needs to work with an input method, regardless of whether it is focusable.
Link copied to clipboard
val MATCH_PARENT: Int = -1
Alias for MATCH_PARENT.
Link copied to clipboard
The provided prompt view should appear above list content.
Link copied to clipboard
The provided prompt view should appear below list content.
Link copied to clipboard
val WRAP_CONTENT: Int = -2
Alias for WRAP_CONTENT.

Functions

Link copied to clipboard
Clear any current list selection.
Link copied to clipboard
Returns an OnTouchListener that can be added to the source view to implement drag-to-open behavior.
Link copied to clipboard
open fun dismiss()
Dismiss the popup window.
Link copied to clipboard
@Nullable
open fun getAnchorView(): @Nullable View
Returns the view that will be used to anchor this popup.
Link copied to clipboard
Returns the animation style that will be used when the popup window is shown or dismissed.
Link copied to clipboard
@Nullable
open fun getBackground(): @Nullable Drawable
Link copied to clipboard
@Nullable
open fun getEpicenterBounds(): @Nullable Rect
Return custom anchor-relative bounds of the popup's transition epicenter
Link copied to clipboard
open fun getHeight(): Int
Link copied to clipboard
Link copied to clipboard
Return the current value in setInputMethodMode.
Link copied to clipboard
@Nullable
open fun getListView(): @Nullable ListView
Link copied to clipboard
Link copied to clipboard
@Nullable
open fun getSelectedItem(): @Nullable Any
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@Nullable
open fun getSelectedView(): @Nullable View
Link copied to clipboard
open fun getSoftInputMode(): Int
Returns the current value in setSoftInputMode.
Link copied to clipboard
Link copied to clipboard
open fun getWidth(): Int
Link copied to clipboard
Link copied to clipboard
open fun isModal(): Boolean
Returns whether the popup window will be modal when shown.
Link copied to clipboard
open fun isShowing(): Boolean
Link copied to clipboard
open fun onKeyDown(keyCode: Int, @NonNull event: @NonNull KeyEvent): Boolean
Filter key down events.
Link copied to clipboard
open fun onKeyPreIme(keyCode: Int, @NonNull event: @NonNull KeyEvent): Boolean
Filter pre-IME key events.
Link copied to clipboard
open fun onKeyUp(keyCode: Int, @NonNull event: @NonNull KeyEvent): Boolean
Filter key up events.
Link copied to clipboard
open fun performItemClick(position: Int): Boolean
Perform an item click operation on the specified list adapter position.
Link copied to clipboard
open fun postShow()
Post a show call to the UI thread.
Link copied to clipboard
open fun seslForceShowUpper(force: Boolean)
Link copied to clipboard
open fun setAdapter(@Nullable adapter: @Nullable ListAdapter)
Sets the adapter that provides the data and the views to represent the data in this popup window.
Link copied to clipboard
open fun setAnchorView(@Nullable anchor: @Nullable View)
Sets the popup's anchor view.
Link copied to clipboard
open fun setAnimationStyle(@StyleRes animationStyle: Int)
Set an animation style to use when the popup window is shown or dismissed.
Link copied to clipboard
open fun setBackgroundDrawable(@Nullable d: @Nullable Drawable)
Sets a drawable to be the background for the popup window.
Link copied to clipboard
open fun setContentWidth(width: Int)
Sets the width of the popup window by the size of its content.
Link copied to clipboard
open fun setDropDownAlwaysVisible(dropDownAlwaysVisible: Boolean)
Sets whether the drop-down should remain visible under certain conditions.
Link copied to clipboard
open fun setDropDownGravity(gravity: Int)
Set the gravity of the dropdown list.
Link copied to clipboard
open fun setEpicenterBounds(@Nullable bounds: @Nullable Rect)
Specifies the custom anchor-relative bounds of the popup's transition epicenter.
Link copied to clipboard
open fun setForceIgnoreOutsideTouch(forceIgnoreOutsideTouch: Boolean)
Forces outside touches to be ignored.
Link copied to clipboard
open fun setHeight(height: Int)
Sets the height of the popup window in pixels.
Link copied to clipboard
open fun setHorizontalOffset(offset: Int)
Set the horizontal offset of this popup from its anchor view in pixels.
Link copied to clipboard
open fun setInputMethodMode(mode: Int)
Control how the popup operates with an input method: one of INPUT_METHOD_FROM_FOCUSABLE, INPUT_METHOD_NEEDED, or INPUT_METHOD_NOT_NEEDED.
Link copied to clipboard
open fun setIsOverflowPopup(overflowPopup: Boolean)
Link copied to clipboard
open fun setListSelector(selector: Drawable)
Sets a drawable to use as the list item selector.
Link copied to clipboard
open fun setModal(modal: Boolean)
Set whether this window should be modal when shown.
Link copied to clipboard
Set a listener to receive a callback when the popup is dismissed.
Link copied to clipboard
open fun setOnItemClickListener(clickListener: @Nullable AdapterView.OnItemClickListener)
Sets a listener to receive events when a list item is clicked.
Link copied to clipboard
open fun setOnItemSelectedListener(@Nullable selectedListener: @Nullable AdapterView.OnItemSelectedListener)
Sets a listener to receive events when a list item is selected.
Link copied to clipboard
open fun setOverlapAnchor(overlapAnchor: Boolean)
a submenu correctly.
Link copied to clipboard
open fun setPromptPosition(position: Int)
Set where the optional prompt view should appear.
Link copied to clipboard
open fun setPromptView(@Nullable prompt: @Nullable View)
Set a view to act as a user prompt for this popup window.
Link copied to clipboard
open fun setSelection(position: Int)
Set the selected position of the list.
Link copied to clipboard
open fun setSoftInputMode(mode: Int)
Sets the operating mode for the soft input area.
Link copied to clipboard
open fun setVerticalOffset(offset: Int)
Set the vertical offset of this popup from its anchor view in pixels.
Link copied to clipboard
open fun setWidth(width: Int)
Sets the width of the popup window in pixels.
Link copied to clipboard
open fun setWindowLayoutType(layoutType: Int)
Set the layout type for this popup window.
Link copied to clipboard
open fun show()
Show the popup list.